<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="/public/css/bootstrap.min.css" rel="stylesheet" media="screen">
<title>图书管理</title>
<script src="/public/js/bootstrap.min.js"></script>
<script src="/public/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
   function delbook(id){
	  if(confirm("确定删除吗？")){
		  $.get("__URL__/bookdel",{id:id},
			function(data){
				if(data){
				  $("tr#"+id+"").hide();
				  alert("删除成功！");	
				}  
			}
		  );	
	  }
	}
</script>
</head>

<body>
<div class="row-fluid">
  <h1 class="text-center">图书管理</h1>
  <hr class="info">
</div>

<div class="row-fluid">
<div class="span12">
<form method='post'  class="form-inline" action="__URL__/bookadd">
  <fieldset class="text-center">
    <label>图书名称：</label>
    <input name="Book_Name" type="text" />
    <label>ISBN: </label>
    <input name="Book_Isbn" type="text" placeholder="书本背面的条码编号" />
    <label> 数量:</label>
    <input name="Book_Number" type="text" value="1" class="input-mini" />
    <button type="submit"  class="btn btn-primary">添加图书</button>
    <button class="btn" type="reset">取消</button>
  </fieldset>
</form>
</div>
</div>

<div class="row-fluid">
  <div class="span10 offset1">
    <!--图书列表-->
    <table class="table table-bordered">
      <thead>
          <tr>
            <th>书名</th>
            <th>ISBN</th>
            <th>库存数量</th>
            <th>操作</th>
          </tr>
      </thead>
      <tbody>
          <volist name="data" id="vo">
          <tr id="{$vo.Book_ID}">
            <td>{$vo.Book_Name}</td>
            <td>{$vo.Book_Isbn}</td>
            <td>{$vo.Book_Number}</td>
            <td><button type="button" class="btn btn-info">编辑</button>
            <button type="button" class="btn btn-danger" onclick="delbook({$vo.Book_ID})" >删除</button></td>
          </tr>
          </volist>
      </tbody>
    </table>
    </div>
</div>
</body>
</html>